<?php
	/**
	 * MySQL database query adapter.
	 * @author IMP
	 */ 
	
	class MySQLQueryResult extends DatabaseQueryResult {
		private $resource;
		
		public function __construct($resource){ 		$this->resource = $resource; 							}
		protected function __fetchAssoc(){ 				return mysql_fetch_assoc($this->resource); 				}
		protected function __fetchArray(){ 				return mysql_fetch_array($this->resource, MYSQL_NUM); 	}
		protected function __fetchObject(){ 			return mysql_fetch_object($this->resource, 'stdClass'); }
		protected function __getRowCount(){ 			return mysql_num_rows($this->resource); 				}
		protected function __getFieldType($id){ 		return mysql_field_type($this->resource, $id); 			}
		protected function __getFieldTable($id){ 		return mysql_field_table($this->resource, $id);	 		}
		protected function __getFieldFlags($id){ 		return mysql_field_flags($this->resource, $id);			}
		protected function __getFieldCount(){ 			return mysql_num_fields($this->resource); 				}
		protected function __getFieldLength($id){ 		return mysql_field_name($this->resource, $id); 			}
		protected function __getFieldName($id){ 		return mysql_field_name($this->resource, $id); 			}
		protected function __free(){ 					return mysql_free_result($this->resource); 				}
		protected function __fetchField($row, $id){		return mysql_result($this->resource, $row, $id); 		}
	}
?>